package com.fsy.algorithm;

import java.util.Vector;

/**
 * Created by shuangyu.feng on 2017/7/13.
 */
public class VData extends Vector{
    public VData() {
    }

    public static void main(String[] args) {
    }

    public String encode() {
        String strReturn = "";
        return strReturn;
    }

    public Object getObjectByObjectName(String cObjectName, int cStartPos) {
        String tStr1 = "";
        String tStr2 = "";
        Object tReturn = null;
        if(cStartPos < 0) {
            cStartPos = 0;
        }

        int iMax = this.size();

        try {
            for(int i = cStartPos; i < iMax; ++i) {
                tStr1 = this.get(i).getClass().getName().toUpperCase();
                tStr2 = cObjectName.toUpperCase();
                if(tStr1.equals(tStr2) || this.getLastWord(tStr1, ".").equals(tStr2)) {
                    tReturn = this.get(i);
                    break;
                }
            }
        } catch (Exception var9) {
            tReturn = null;
        }

        return tReturn;
    }

    public String getLastWord(String cStr, String splitStr) {
        int tIndex = -1;
        int tIndexOld = -1;
        String tReturn = cStr;

        try {
            while(true) {
                tIndex = tReturn.indexOf(splitStr, tIndex + 1);
                if(tIndex <= 0) {
                    if(tIndexOld > 0) {
                        tReturn = cStr.substring(tIndexOld + 1, cStr.length());
                    } else {
                        tReturn = cStr;
                    }
                    break;
                }

                tIndexOld = tIndex;
            }
        } catch (Exception var7) {
            tReturn = "";
        }

        return tReturn;
    }

    public Object getObject(int cIndex) {
        Object tReturn = null;
        if(cIndex < 0) {
            cIndex = 0;
        }

        try {
            tReturn = this.get(cIndex);
        } catch (Exception var4) {
            tReturn = null;
        }

        return tReturn;
    }
}
